﻿
Partial Class pruebas_PopupControles
    Inherits System.Web.UI.Page


    Public Function DevuelvePanel() As Panel
        Dim myPanel As New Panel
        Dim sqlData As New SqlDataSource
        Dim elGriw As New GridView

        sqlData.ConnectionString = ConfigurationManager.ConnectionStrings("GanaderiaConnectionString").ConnectionString
        sqlData.SelectCommand = "SELECT [AnimalId], [sexo], [numero], [letra], [ano], [nombre] FROM [animal] WHERE (([hierro] = 'SFC') AND ([fechabaja] IS NULL))"
        elGriw.DataSource = sqlData
        elGriw.AutoGenerateColumns = True
        elGriw.DataBind()
        myPanel.Controls.Add(sqlData)
        myPanel.Controls.Add(elGriw)
        myPanel.Visible = True


        Return myPanel

    End Function
    
    Protected Sub txtNo_Padre_TextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles txtNo_Padre.TextChanged
        Panel1 = DevuelvePanel()
    End Sub

End Class
